package com.chinasofti.project.common.pageQuery;

import java.util.List;

import com.chinasofti.project.common.result.ResultBase;

/**
 * 分页查询结果
 * @author Lucas
 *
 * @param <T>
 */
public class PageResult<T> extends ResultBase {
	/**
	 * 总条数
	 */
	private long totalCount;

	/**
	 * 总页数
	 */
	private long totalPage;
	
	/**
	 * 查询结果
	 */
	private List<T> resultList;
	
	public PageResult(long totalCount, long pageSize,List<T> resultList) { 
		this.totalCount=totalCount;
		this.totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : (totalCount / pageSize + 1);
		this.resultList=resultList;
	}

	public long getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}

	public List<T> getResultList() {
		return resultList;
	}

	public void setResultList(List<T> resultList) {
		this.resultList = resultList;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

}
